package com.seraph.td.tools;

public class Root implements UuseeYVUWriter.CompleteListener {
	private static byte[][] raws=new byte[1024][1024];
	private boolean complementFlg = false;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		initdata();
		Root r = new Root();
		r.test();
	}
	void test(){
		UuseeYVUWriter mWriter =	new UuseeYVUWriter("raw.data",this);
		mWriter.start();
		for(int i = 0 ; i<1024;i++){

				mWriter.upDate(raws[i]);
				System.out.println("current cout===="+i);

		}
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		mWriter.stop();
		System.out.println("OK");	
	}
	
	
	
	/**
	 * 
	 */
	static void initdata(){
		byte data = 0;
		for(int i = 0 ;i<1024;i++){
			for(int j = 0 ; j<1024;j++){
				raws[i][j] = data;
			}
			data++;
			if(data > Byte.MAX_VALUE) data= Byte.MIN_VALUE;
		}
	}

	@Override
	public void OnComplente() {
		// TODO Auto-generated method stub
		complementFlg = true;
	}
}
